package Q2;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        Set<String> set = new HashSet<>();

        while (n > 0) {
            n--;
            String str = scanner.next();
            char[] ch = str.toCharArray();
            Arrays.sort(ch);
            String temp = new String(ch);
            set.add(temp);
        }

        System.out.println(set.size());

    }
}
